﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainMaster.master" AutoEventWireup="true" CodeFile="ShareVPSL.aspx.cs" Inherits="ShareVPSL" EnableEventValidation="true" culture="auto" meta:resourcekey="PageResource1" uiculture="auto"  %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/MediaControl.ascx" TagName="MediaControl" TagPrefix="mc" %>

<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <title>المكتبة المرئية</title>
    <link href="jqModal.css" rel="stylesheet" type="text/css" />
    <script src="jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="jqModal.js" type="text/javascript"></script>
   <script type='text/javascript' src='swfobject.js'></script>
<script type="text/javascript">
    var mval;
    function there1() {

        $("#dialog").jqm({ modal: true }).jqmShow();
        setvalue('p');
    }
    function there2() {

        $("#dialog").jqm({ modal: true }).jqmShow();
        setvalue('v');

    }
    
    function makedis(dd) {
        
        setvalue(dd);
        var y = document.getElementById('PCorLk');
        y.style.display = "block";
         
    }
    function makedis2() {
        
        var y = document.getElementById('PCorLk');
        y.style.display = "none";

    }
    function setfocus() {
        there();
        makedis2();
        var dd = document.getElementById("lk");
        dd.style.display = "block";
        var dd = document.getElementById("ups");
        dd.style.display = "none";

    }
    function linksv(bb) {
       
        setvalue(bb);
        setfocus();
        
    }
    function setfocus2up() {
        there();
        makedis2();
       var dd = document.getElementById("lk");
       dd.style.display = "none";
       var dd = document.getElementById("ups");
       dd.style.display = "block";

        
    }
    function uploadError(sender, args) {
        var result = document.getElementById("<%= results.ClientID %>");
        result.value = "يوجد خطأ فى التحميل";
    }
    function setvalue(mm) 
    {
        var dd = document.getElementById("<%= p_or_v.ClientID %>");
        dd.value = mm;
        mval = mm;

    }
    function set_ups_or_lk_value(mm) {
        var dd = document.getElementById("<%= ups_or_lk.ClientID %>");
        dd.value = mm;
        mval = mm;

    }
 function uploadStarted(sender, args) {
     {
         var fileName = args.get_fileName();
        // alert(mval);


         var fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1);
         switch (mval)
          {
              case "2":
                  if (!(fileExtension == 'jpg' || fileExtension == 'jpeg' || fileExtension == 'png' || fileExtension == 'gif')) {
                      alert("png,gif,jpgالامتدادات المسموحة ");
                  
                     
                      ifIgnoreError = true;
                      sender._stopLoad();
                     
                  }
                  break;
             case "1":
                 if (fileExtension != 'flv') {
                     alert("flv الامتدادات المسموحة ");
                
               
                     ifIgnoreError = true;
                     sender._stopLoad();
                 }
                 break;
         }
        
     }
     
 }
    function uploadComplete(sender, args) {
        var contentType = args.get_contentType();
        var text = args.get_length() + " bytes";
       // alert(contentType);
        if (contentType.length > 0) {
            text += ", '" + contentType + "'";
            
        }
        var result = document.getElementById("<%= results.ClientID %>");
        result.value = text;
    }
    $(function () {
        $('#ups').css('display', 'none');
        $('#showlk').css('display', 'none');

        $('#showups').click(function () {
            $('#showlk').css('display', '');
            $('#ups').css('display', '');
            $(this).css('display', 'none');
            $('#lk').css('display', 'none');
            set_ups_or_lk_value('ups');
            return false;
        });

        $('#showlk').click(function () {
            $('#showups').css('display', '');
            $('#lk').css('display', '');
            $(this).css('display', 'none');
            $('#ups').css('display', 'none');
            set_ups_or_lk_value('lk');
            return false;
        });


    });
    </script>
    <style type="text/css">
        .newzr3{
	background:  url('images/Untitled-2_03.png') right ;

	height:34px;
	 background-repeat:no-repeat;
	 float:left;
	 margin-top:-5px;
	 text-align: center;
	 padding-right:15px;
	 cursor:pointer;
	 font-family:Tahoma;
	 font-size:14px;
	 color:#003353;
	 text-decoration:none;
	 
}
.newzr3:hover{
	color: #00b4ff;
	background-image:url('images/Untitled-2ho_03.png');
	background-repeat:no-repeat;

}
        	
        	.zr3 {
	background-image:url('images/button2.png');
	display:block;
	float:right;
	 padding: 0px 10px 0px 10px;
	height:21px;
	text-align:center;
	color:#fff;
	text-shadow:1px 1px 0px #003a5e;
	margin-right:2px;
	line-height:19px;
	font-weight:bold;
	text-decoration:none;
	font-family:Tahoma;
	font-size:12px;


}
.zr3:hover ,.zr3:active {
	background-image:url('images/button2.png');
	text-shadow:1px 1px 0px #003a5e;
	background-position:0px -21px;
	
}
  .stylelabel3
       {
       	color:#064c66;
	 font-weight:bold;
	 direction:rtl;
	 text-align:right;
       	}
             .tab3{
	width:815px;
 direction:rtl;
 border:1px #ccc solid;
 border-radius:5px;
 }

tr .tabbone3{
	 background-color:#028ac5;
	 font-size:11px;
	 line-height:20px;
	 font-family:Tahoma;
  	 color:#fff;
  	 text-align:center;
	
}
 .req3
       {
           color:Red;
       } 
.adel3{
	background-color:#ededed;
	font-size:10px;
	color:#084f86;
	font-family:Tahoma;
	height:30px;
	text-align:  center;
}
.he3{
	background-color:#fff;
	padding:5px;
	font-family:Tahoma;
	font-size:14px;
	font-weight:bold;
}
        .jqmWindow {
    display: none;
    
    position: fixed;
    top: 35%;
    left: 50%;
    
    margin-left: -300px;
    width: 823px;
    
    background-color: #fff;
    color: #333;
    border: 1px solid black;
    padding: 12px;
}

.jqmOverlay { background-color: #000; }

/* Fixed posistioning emulation for IE6
     Star selector used to hide definition from browsers other than IE6
     For valid CSS, use a conditional include instead */
* html .jqmWindow 
{
     position: absolute;
     top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px');
}
        #alls
        {
            width: 200px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 
    
<div class="jqmWindow" id="dialog" dir="rtl" style="width:600px" >

<a href="#" class="jqmClose" style="background-image:url('images/close.png');
	 width:39px;
	 height:40px;
	  background-repeat:no-repeat;
	  display:block;
	  float:left;	"></a>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
         <div>
          
   
    <div  style="height:110px" >
         <table width="100%">
         <tr>
          <td >
         
                 <asp:Label CssClass="stylelabel3" ID="Label4" runat="server"  meta:resourceKey="link" Text="الرابط"/>
              </td>
         <td>
<div id="lk">
             <asp:TextBox ID="mylink" runat="server" meta:resourcekey="mylinkResource1" 
                     Height="24px" Width="402px"></asp:TextBox>
                      <a style="padding-right:20px; font-size:large;" id="showups" href="ShareVpsL.aspx"><asp:Localize ID="Localize1" runat="server" Text="ملف" meta:resourcekey="FileLinkbutton"/></a>
</div>
<div id="ups" dir ="ltr" style="float:right;" >
<a style="padding-right:20px; font-size:large;"  id="showlk" href="ShareVpsL.aspx" ><asp:Localize runat="server" Text="رابط" meta:resourcekey="LinkLinkbutton"/> </a>
 <asp:Label runat="server" ID="myThrobber" Style="display: none;" 
             meta:resourcekey="myThrobberResource1" Text="

                     &lt;img align=&quot;middle&quot; alt=&quot;&quot; src=&quot;uploading.gif&quot; /&gt;
                     "></asp:Label>
                     <asp:AsyncFileUpload ID="AsyncFileUpload1"  
            OnClientUploadError="uploadError" OnClientUploadComplete="uploadComplete" 
            runat="server"    Width="402px" UploaderStyle="Modern"  
            UploadingBackColor="#CCFFFF" ThrobberID="myThrobber" 
             OnClientUploadStarted="uploadStarted" FailedValidation="False" 
             meta:resourcekey="AsyncFileUpload1Resource1" />
             
                     </div>
         </td>
        
         </tr>
         <tr>
         <td >
         
             <asp:Label CssClass="stylelabel3" ID="Label3" runat="server"  meta:resourceKey="comment" Text="التعليق"/>
         </td><td>
         
         <asp:TextBox ID="mycomment" runat="server" meta:resourcekey="mycommentResource1" 
                 Width="402px" Height="63px" TextMode="MultiLine"></asp:TextBox>
             </td></tr>
         
         </table>
       </div>
        <asp:Label ID="results" runat="server" meta:resourcekey="resultsResource1"></asp:Label>
        <br />
        <input id="ups_or_lk" runat="server"  type="hidden" />
             </input>
             <input id="p_or_v" runat="server" type="hidden"> </input>
                 <table width="100%">
                     <tr>
                         <td align="left" style="padding-right:400px;">
                             <asp:Button ID="end" runat="server" CssClass="zr3" meta:resourceKey="end" 
                                 OnClick="end_Click" Text="حفظ" />
                         </td>
                     </tr>
                 </table>
             </input>
            </div>
    </ContentTemplate>
    <Triggers>
    <asp:PostBackTrigger ControlID="end" />
    </Triggers>
    </asp:UpdatePanel>

</div>


<%--<div>
<table><tr><td><a href="AllVideos.aspx">كل الفيديوهات</a></td><td><a href="AllPhotos.aspx">كل الصور</a></td><td><a href="#"></a></td></tr></table>
</div>--%>
    <asp:HiddenField ID="typevalue" runat="server" Value="0" />
   <%-- <asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="true">
    <ContentTemplate>--%>
  <div dir="rtl">
  <br />
  <table width="100%">
  <tr>
  <td align="center">
      
     <a href="ShareVpsl.aspx">
    <img src="icons/photo.png"  alt="" onclick="there1();return false;"/>
    </a>
    </td>
  <td align="center">
  
  <a href="ShareVpsl.aspx">
    <img src="icons/video.png" alt="" onclick="there2();return false;" />
     </a>
    </td>
  </tr>
  <tr>
  <td align="center"><asp:Label ID="Label2" CssClass="stylelabel3" runat="server" 
          Text="إضافة صورة جديدة" meta:resourcekey="Label2Resource1"></asp:Label></td>
  <td align="center"><asp:Label ID="Label5" CssClass="stylelabel3" runat="server" 
          Text="إضافة فيديو جديد" meta:resourcekey="Label5Resource1"></asp:Label></td>
  </tr>

  </table>
  <br />
<div>
 <div >
                    <table class="tab3">
                        <tr>
                            <td class="tabbone3" >
                                <asp:Label   ID="lblfilter" runat="server" Text="فلترة الجهات" meta:resourceKey="lblfilter" />
                                
                            </td>
                            
                            </tr>
                         <tr>
                         <td class="adel3">
                         
                                <asp:DropDownList ID="allcompanies" runat="server" style="border:solid 1px black"
                                     
                                    onselectedindexchanged="comps_SelectedIndexChanged" AutoPostBack="True" 
                                    AppendDataBoundItems="True" Width="200px" 
                                    meta:resourcekey="allcompaniesResource1" >
                                    <asp:ListItem Value="-1" meta:resourceKey="all" Text="الكل"></asp:ListItem>
                                     <asp:ListItem Value="1" meta:resourceKey="stop" Text="فيديو"></asp:ListItem>
                                       <asp:ListItem Value="2" meta:resourceKey="active" Text="صورة"></asp:ListItem>
                                </asp:DropDownList>
                                
                         </td>
                         </tr>
                            </table>
                            <br />
</div>
     <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT [id], [scomment], [link], [mtype] FROM [media] ">
    </asp:SqlDataSource>
    <div dir="rtl" align="right" >
        <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" 
            RepeatColumns="3" CellPadding="5" CellSpacing="5" >
            <ItemTemplate>
            <asp:ImageButton ID="close" runat="server" ImageUrl="~/icons/close.jpg"  
            CommandArgument='<%# Bind("id") %>' OnClick="close_Click" 
            meta:resourcekey="closeResource1" />
           
            <asp:Label ID="Label1" 
            CssClass="stylelabel3" runat="server" Text="مسح" 
            meta:resourcekey="Label1Resource1"></asp:Label>

            <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" 
                                                    ConfirmText="<%$ Resources:Resource, delconfirm %>" 
                                        TargetControlID="close" Enabled="True" />
          
                    <br />
                     <a href='<%# "ShowMedia.aspx?id=" + Eval("id").ToString() %>'>
                    <asp:Image ID="Image1" runat="server" Height="122px" 
                    ImageUrl='<%# Eval("mtype").ToString()=="2"? Eval("link") :"images/videoplay.jpg" %>' Width="227px" />
                   <br />
                   <asp:Label ID="Label6" runat="server" Text='<%# (Eval("scomment").ToString().Length>=30) ? Eval("scomment").ToString().Substring(0,30)+"..." :Eval("scomment").ToString() %>' />

                   </a>
            </ItemTemplate>
        </asp:DataList>
    </div>
    <br />
 
    <br />
    <center>
    <div align="center" id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="<%=Request.Url.AbsoluteUri %>" num_posts="2" width="500"></fb:comments>
    </center>
    </div>
    
    </div>
</asp:Content>

